Technical Field
This disclosure relates to dynamically selecting a micro-threading mode of a processor based on system usage.
Description of Related Art
This disclosure relates to the issue of choosing a micro-threading mode of certain processors, such as the POWER8™ processor designed by International Business Machines Corporation. The micro-threading mode is used with certain applications, such as the PowerKVM™ virtualization product. IBM's POWER8 processor core has three modes available to be selected by hypervisor software, which affect how many distinct logical partitions also known as virtual machines, or guests) can run concurrently on the core and what simultaneous multi-threading (SMT) modes can be utilized by those logical partitions.
The POWER8 core has the capability of running up to 8 threads of execution. The three modes are: (1) whole-core mode (MT1), (2) two-way micro-threading mode (MT2), and (3). In whole-core mode (MT1) only one logical partition can run on the core, and that logical partition can run in single-thread (ST) mode, two threads/core mode (SMT2), four threads/core mode (SMT4), or eight threads/core mode (SMT8), at its discretion. All eight threads, 0-7, are available to the single logical partition running on the core. The core reconfigures its resources automatically according to how many threads are running, which means that a thread will execute faster in ST mode than in SMT8 mode (though the aggregate performance of 8 threads in SMT8 mode is usually greater than the performance of one thread in ST mode).
In two-way micro-threading mode (MT2), two distinct logical partitions can run simultaneously, one using threads 0-3 and the other using threads 4-7, that is, the core is split into two subcores. Internally, the core is always in SMT8 mode, which has the consequence that even if only one thread is active and the others are all idle, the performance of that thread is lower than in single-thread (ST) mode. ST mode is only available when the processor core is in whole-core mode.
In four-way micro-threading mode (MT4), four distinct logical partitions can run simultaneously, using threads 0-1, 2-3, 4-5 and 6-7 respectively, that is, the core is split into four subcores. Internally, the core is always in SMT8 mode, as for two-way micro-threading mode.
Kernel Virtual Machine (KVM) for POWER™, also known as PowerKVM™, is a Linux®-based hypervisor for IBM POWER8™ machines. It utilizes a Linux® kernel running as the host operating system (OS). The Linux kernel runs in the processor's hypervisor mode and has access to all the facilities of the machine. It supports guest logical partitions through the facilities provided by the KVM module, which is a component of the Linux kernel. It provides a full OS environment, with a process scheduler, virtual memory management, file systems, network stacks, and device drivers, and supports execution of processes in user space.
PowerKVM includes two components which run as user-space processes: QEMU and libvirtd. To initiate a new guest logical partition, a file describing the characteristics of the new guest partition in XML format is created. This file contains details of the number of virtual CPUs, amount of memory, and virtual and real I/O devices to be assigned to the guest partition. A new guest is started by issuing a command to libvirtd specifying the guest XML file. Libvirtd then starts a QEMU process, which uses the facilities of the KVM module to create the guest and start it executing.
One of the details provided in the guest XML file is the virtual SMT mode for the guest partition, that is, the number of guest virtual CPUs (vCPUs) in each virtual core (vcore). The virtual SMT (vSMT) mode can be specified to be 1, 2, 4 or 8, or left unspecified, in which case it is taken to be 1. The KVM module gives effect to the virtual SMT mode by ensuring that vCPUs in the same vcore always run together on a physical core when they are executing in the guest. Existing releases of PowerKVM support a single system-wide selection of micro-threading mode. The selected mode applies to all processor cores and can be changed only when no guests are running.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.